<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" lang="zh">
<head>
    <th:block th:include="include :: header('条形码列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">

        <div class="col-sm-12 search-collapse none">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <p>识别码：</p>
                            <input type="text" name="codeid"/>
                        </li>
                        <li>
                            <p>类别：</p>
                            <select name="trashType" th:with="type=${@dict.getType('yf_trash_type')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li>
                            <p>重量：</p>
                            <input type="text" name="weight"/>
                        </li>

                        <li shiro:hasAnyRoles="admin,admin_m">
                            <p>重量：</p>
                            <select name="weightInputType" th:with="type=${@dict.getType('yf_weight_type')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <!--<li shiro:hasAnyRoles="admin,admin_m,admin_m_">-->
                        <!--<p>医院：</p>-->
                        <!--<select name="stagingId" th:with="type = ${@dep.depts(null,null)}">-->
                        <!--<option  value="">所有</option>-->
                        <!--<option th:each="d : ${type}" th:text="${d.deptName}"-->
                        <!--th:value="${d.deptId}"></option>-->
                        <!--</select>-->
                        <!--</li>-->

                        <li>
                            <p>科室：</p>
                            <select name="sourceDeptId" id="sourceDeptId">
                                <option value="">所有</option>
                                <!--                                查询的是当前角色下医院部门 的所有科室-->
                                <!--                                <option th:each="s : ${@dep.yfDeptListAll()}" th:text="${s.deptName}"-->
                                <!--                                        th:value="${s.deptId}"></option>-->
                            </select>
                        </li>

                        <li class="select-time" shiro:hasRole="hidden">
                            <p>扫描来源科室时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginScanDeptDate]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endScanDeptDate]"/>
                        </li>

                        <li>
                            <p>状态：</p>
                            <select name="trashStatus" th:with="type=${@dict.getType('yf_trash_status')}">
                                <option value="">所有</option>
                                <!-- 管理员-->
                                <option shiro:hasRole="admin" th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                                <!-- 非管理员 -->
                                <option shiro:lacksRole="admin" th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"
                                        th:if="${dict.dictValue}>9 and ${dict.dictValue}< 31 "></option>
                            </select>
                        </li>

                        <li shiro:hasAnyRoles="admin">
                            <p>更新方式：</p>
                            <select name="updateWay" th:with="type=${@dict.getType('yf_update_way')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>

                        <li shiro:hasRole="hidden">
                            <p>采集用户sys_user表：</p>
                            <input type="text" name="collectUserId"/>
                        </li>
                        <li shiro:hasRole="hidden">
                            <p>来源垃圾桶id yf_bucket表：</p>
                            <input type="text" name="sourceBucketId"/>
                        </li>
                        <li class="select-time" shiro:hasRole="hidden">
                            <p>采集扫码时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginCollectScanDate]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endCollectScanDate]"/>
                        </li>

                        <li>
                            <p>采集员：</p>
                            <input type="text" name="collectUserName"/>
                        </li>


                        <li class="select-time">
                            <p>采集时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginCollectUpdateDate]" autocomplete="off"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endCollectUpdateDate]" autocomplete="off"/>
                        </li>


                        <li shiro:hasRole="hidden">
                            <p>入库用户 sys_user表：</p>
                            <input type="text" name="intoUserId"/>
                        </li>

                        <li shiro:hasRole="hidden">
                            <p>入库垃圾桶id yf_bucket表：</p>
                            <input type="text" name="intoBucketId"/>
                        </li>
                        <li class="select-time" shiro:hasRole="hidden">
                            <p>入库时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginIntoDate]" autocomplete="off"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endIntoDate]" autocomplete="off"/>
                        </li>
                        <li shiro:hasRole="hidden">
                            <p>出库用户 sys_user：</p>
                            <input type="text" name="outUserId"/>
                        </li>
                        <li shiro:hasRole="hidden">
                            <p>出库垃圾桶id yf_bucket表：</p>
                            <input type="text" name="outBucketId"/>
                        </li>
                        <li class="select-time" shiro:hasRole="hidden">
                            <p>出库时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginOutDate]" autocomplete="off"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endOutDate]" autocomplete="off"/>
                        </li>

                        <li class="select-time" shiro:hasRole="hidden">
                            <p>创建时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginCreateTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endCreateTime]"/>
                        </li>
                        <li class="select-time" shiro:hasRole="hidden">
                            <p>更新时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginUpdateTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endUpdateTime]"/>
                        </li>

                        <li shiro:hasRole="hidden">
                            <p>出库运输车辆id：</p>
                            <input type="text" name="outCarId"/>
                        </li>
                        <li shiro:hasRole="hidden">
                            <p>异常状态0:正常 1:异常 yf_exception_level：</p>
                            <select name="status" th:with="type=${@dict.getType('yf_exception_level')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" id="btnRefresh"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="yf:disposalCompanyTag:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-success" onclick="to();" shiro:hasPermission="yf:disposalCompanyTag:adds">
                <i class="fa fa-plus"></i> 批量添加
            </a>
            <a class="btn btn-primary single disabled" onclick="ed();" shiro:hasPermission="yf:disposalCompanyTag:edits">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="yf:disposalCompanyTag:edit">
                <i class="fa fa-edit"></i> 高级修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.UremoveAll()"
               shiro:hasPermission="yf:disposalCompanyTag:Uremove">
                <i class="fa  fa-trash-o"></i> 删除
            </a>
            <!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"-->
               <!--shiro:hasPermission="yf:tag:remove">-->
                <!--<i class="fa fa-remove"></i> 彻底删除-->
            <!--</a>-->
            <a class="btn btn-primary multiple disabled" onclick="$.operate.URecoveryAll()"
               shiro:hasPermission="yf:disposalCompanyTag:URecoveryAll">
                <i class="fa fa-history"></i> 恢复
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="yf:disposalCompanyTag:export">
                <i class="fa fa-download"></i> 导出
            </a>
            <a class="btn btn-warning" onclick="tablePrint();">
                <i class="fa fa-download"></i> 打印
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" cellpadding="4" cellspacing="0"
                   style=" table-layout: fixed; word-break: break-all;"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:src="@{/js/JsBarcode.all.min.js}"></script>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('yf:disposalCompanyTag:edit')}]];
    var removeFlag = [[${@permission.hasPermi('yf:disposalCompanyTag:remove')}]];//删除
    var uRemoveFlag = [[${@permission.hasPermi('yf:disposalCompanyTag:uRemove')}]];//假删除
    var UremoveFlag = [[${@permission.hasPermi('yf:disposalCompanyTag:Uremove')}]];//标记删除
    var URecovery = [[${@permission.hasPermi('yf:disposalCompanyTag:Urecovery')}]];//标记删除恢复
    var printsFlag = [[${@permission.hasPermi('yf:disposalCompanyTag:Uremove')}]];//打印权限


    var trashTypeDatas = [[${@dict.getType('yf_trash_type')}]];
    var weightInputTypeDatas = [[${@dict.getType('yf_weight_type')}]];
    var trashStatusDatas = [[${@dict.getType('yf_trash_status')}]];
    var delFlagDatas = [[${@dict.getType('del_flag')}]];
    var statusDatas = [[${@dict.getType('yf_exception_status')}]];
    var updateWayDatas = [[${@dict.getType('yf_update_way')}]];
    var prefix = ctx + "yf/disposalCompanyTag";


    //超级管理员权限
    var admin = [[${@permission.isAnyRoles('admin')}]]
    //平台管理员权限
    var admin_m = [[${@permission.isAnyRoles('admin_m')}]]
    //卫健委权限
    var admin_m_ = [[${@permission.isAnyRoles('admin_m_province,admin_m_city,admin_m_county')}]]
    //省级医院
    var admin_h_province = [[${@permission.isAnyRoles('admin_h_province_group,admin_h_province')}]]
    //医院管理员
    var admin_h = [[${@permission.isAnyRoles('admin_h_province,admin_h_city,admin_h_county,admin_x_township')}]];


    $('#btnRefresh').click(function () {
        $.table.search(null, null, {
            stagingId: sessionStorage.getItem("hospital_ids")
        });
    });

    //todo 完善 删除标记后 不能修改信息

    //搜索栏 科室列表
    // 查询当前角色下所有医院的科室 且等于当前页面选择的医院 下的所有科室
    function setSeachDeptList() {
        var hosid = sessionStorage.getItem("hospital_ids");
        $.post(ctx + "yf/dept/getYfDeptListByHospitalId", {hosid: hosid}, function (res) {
            if (res.code == 0 && res.rows != "" && res.rows != null) {     // 如果医院有暂存点
                $.each(res.rows, function (i, data) {
                    $("#sourceDeptId").append("<option value='" + data.deptId + "'>" + data.deptName + "</option>");
                });
            }
        })

        // var seachDeptList = deptd.map(x => {
        //     if (x.hospitalId == hosid) {
        //         $("#sourceDeptId").append("<option value=" + x.deptId + ">" + x.deptName + "</option>");
        //     }
        // })
    }

    //报表打印
    function tablePrint() {
        $.table.tablePrint();
    }

    $(function () {
        setSeachDeptList();
        var width = 60;
        if (editFlag == '') width += 60;
        if (removeFlag == '') width += 90;
        if (UremoveFlag == '') width += 60;
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            UremoveUrl: prefix + "/Uremove",
            exportUrl: prefix + "/export",
            URecoveryUrl: prefix + "/URecovery",
            showToggle: false, //是否显示详细视图和列表视图的切换按钮
            cardView: false,
            modalName: "",
            prints: {
                title: '条形码'
            },
            onLoadSuccess: function (res) {
                //加载条形码图片
                // for (let i = 0; i < res.rows.length; i++) {
                //     let codeid = res.rows[i].codeid;
                //     JsBarcode("img[data-id='" + codeid + "']", codeid, {
                //         format: "CODE128",
                //         height: 200,
                //         width: 10,
                //         fontSize: 80
                //     });
                // }
            },
            height: 600,
            search: false,
            queryParams: queryParams,
            // queryParams: {
            //     stagingId: sessionStorage.getItem("hospital_ids"),
            pageSize: 25,
            // pageNum: 1,
            // },
            rowStyle: rowStyle,//自定义行删除样式

            pageList: [25, 50, 75, 100],
            columns: [
                {
                    field: 'codeid',
                    title: '识别码',
                    align: 'center',
                    width: '200px'
                },
                // {
                //     field: 'codeid',
                //     title: '识别码',
                //     align: 'center',
                //     width: '200px',
                //     formatter: function (value) {
                //         return $.table.image(value, "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594179469455&di=da658556c7545e449dcfcba2198a70f4&imgtype=0&src=http%3A%2F%2Fi0.hdslb.com%2Fbfs%2Farchive%2F1a742135b9c4f8eeb8450ead28b9dc9d987da594.jpg"
                //         );
                //     }
                // },
                {
                    field: 'hospitalId',
                    title: '医院',
                    visible: false,
                    // visible: admin,//隐藏 - 超级管理员 自动隐藏
                    switchable: admin,//禁用 - 超级管理员 可见
                    // formatter: function (value, item, index) {
                    //     return $.table.selectListLabel(dept, item.hospitalId, "deptId", "deptName");
                    // },
                    align: 'center',
                    width: '150px'
                },
                {
                    field: 'stagingName',
                    align: 'center',
                    width: '150px',
                    title: '暂存处',
                    visible: !admin_h,      // 隐藏 - 超级管理员、平台管理员、卫健委可见
                    switchable: !admin_h    // 禁用 超级管理员、平台管理员、卫健委可见
                },
                {
                    field: 'collectUserName',
                    title: '采集员',
                    align: 'center',
                    width: '70px'
                },
                {
                    field: 'sourceBucketId',
                    title: '来源垃圾桶',
                    align: 'center',
                    width: '100px',
                    visible: false,
                    switchable: false
                },
                {
                    field: 'collectScanDate',
                    title: '采集扫码时间',
                    align: 'center',
                    width: '200px', // 超级管理员、管理员可见
                    visible: false,
                    // visible: admin || admin_m,
                    switchable: admin || admin_m
                },
                {
                    field: 'sourceDeptName',
                    title: '来源科室',
                    align: 'center',
                    width: '100px'
                },
                {
                    field: 'nurseName',
                    title: '交接人',
                    align: 'center',
                    width: '100px',
                    visible: admin || admin_m || admin_h_province
                },
                {
                    field: 'scanDeptDate',
                    title: '扫描来源科室时间',
                    align: 'center',
                    width: '160px',
                    visible: false,
                    // visible: admin,
                    switchable: admin
                },
                {
                    field: 'trashType',
                    title: '医废类别',
                    align: 'center',
                    width: '70px',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(trashTypeDatas, value);
                    }
                },
                {
                    field: 'weightInputType',
                    title: '重量输入',
                    align: 'center',
                    width: '100px',
                    visible: false,
                    // visible: admin || admin_m,
                    switchable: admin || admin_m,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(weightInputTypeDatas, value);
                    }
                },
                {
                    field: 'weight',
                    align: 'center',
                    width: '100px',
                    title: '重量（kg）'
                },
                {
                    field: 'bag',
                    align: 'center',
                    width: '100px',
                    title: '数量（袋）'
                    // visible: admin || admin_m,
                    // switchable: admin || admin_m,
                },
                {
                    field: 'collectUpdateDate',
                    align: 'center',
                    width: '200px',
                    title: '采集时间'
                },
                {
                    field: 'intoUserName',
                    align: 'center',
                    width: '70px',
                    title: '入库用户'
                },
                {
                    field: 'intoBucketId',
                    align: 'center',
                    width: '100px',
                    title: '入库垃圾桶',
                    visible: false,
                    switchable: false
                },
                {
                    align: 'center',
                    field: 'intoDate',
                    width: '200px',
                    title: '入库时间'
                },
                {
                    field: 'outUserName',
                    align: 'center',
                    width: '70px',
                    title: '出库用户'
                },
                {
                    field: 'outBucketId',
                    align: 'center',
                    width: '100px',
                    title: '出库垃圾桶',
                    visible: false,
                    switchable: false
                },
                {
                    field: 'outDate',
                    align: 'center',
                    width: '200px',
                    title: '出库时间'
                },
                {
                    field: 'createBy',
                    align: 'center',
                    width: '70px',
                    title: '创建者名',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'createTime',
                    align: 'center',
                    width: '200px',
                    title: '创建时间',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'updateBy',
                    align: 'center',
                    width: '70px',
                    title: '更新者名',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'updateTime',
                    align: 'center',
                    width: '200px',
                    title: '更新时间',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'trashStatus',
                    width: '100px',
                    align: 'center',
                    title: '医废状态',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(trashStatusDatas, value);
                    }
                },
                {
                    field: 'delFlag',
                    align: 'center',
                    width: '100px',
                    title: '标记删除',
                    visible: admin || admin_m,
                    switchable: admin || admin_m,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(delFlagDatas, value);
                    }
                },
                {
                    field: 'outCarId',
                    align: 'center',
                    width: '100px',
                    title: '出库运输',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'collectId',
                    align: 'center',
                    width: '100px',
                    title: '采集设备 id',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'intoId',
                    align: 'center',
                    width: '100px',
                    title: '入库设备 id',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'outId',
                    align: 'center',
                    width: '100px',
                    title: '出库设备 id',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'collectDetails',
                    align: 'center',
                    width: '100px',
                    title: '采集设备信息',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'intoDetails',
                    align: 'center',
                    width: '100px',
                    title: '入库设备信息',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'outDetails',
                    align: 'center',
                    width: '100px',
                    title: '出库设备信息',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin
                },
                {
                    field: 'updateWay',
                    align: 'center',
                    width: '100px',
                    title: '更新方式',
                    visible: !admin && admin_m && admin_m_ && admin_h,//超级管理员隐藏
                    switchable: admin,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(updateWayDatas, value);
                    }
                },
//                {
//                    field: 'img4',
//                    width: '70px',
//                    title: '照片',
//                    visible: !admin_m_,
//                    switchable: !admin_m_,
//                    formatter: function (value, row, index) {
//                        return (value);
//                    }
//                },
                {
                    title: '操作',
                    align: 'center',
                    class: 'controls',
                    width: width + 'px',
                    visible: true,
                    switchable: !admin_m_,
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)"   onclick="avatar(\'' + row.img + '\',\'' + row.img1 + '\',\''+ row.collImg2 + '\',\'' + row.img2 + '\',\'' + row.img3 + '\',\'' + row.img4 + '\')"  ><i class="fa fa-file-photo-o"></i>照片</a> ');
                        actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.codeid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + uRemoveFlag + '" href="javascript:void(0)" onclick="$.operate.Uremove(\'' + row.codeid + '\')"><i class="fa fa-trash-o"></i>删除</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.codeid + '\')"><i class="fa fa-remove"></i>彻底删除</a> ');
                        return actions.join('');
                    }
                }]
        };

        options.columns.unshift({
            checkbox: admin || editFlag || removeFlag || UremoveFlag
        });
        $.table.init(options);

    });

    function queryParams(params) {
        var search = $.table.queryParams(params);
        search.stagingId = sessionStorage.getItem("hospital_ids");
        return search;
    }


    //照片显示
    function avatar(img, img1, collImg2, img2, img3, img4) {
        var data = [];
        if (img != undefined && img != 'null')
            data.push({"alt": "采集", "pid": 1, "src": img});
        if (img1 != undefined && img1 != 'null')
            data.push({"alt": "采集", "pid": 1, "src": img1});
        if (collImg2 != undefined && collImg2 != 'null')
            data.push({"alt": "采集", "pid": 1, "src": collImg2});
        if (img2 != undefined && img2 != 'null')
            data.push({"alt": "运转", "pid": 2, "src": img2});
        if (img3 != undefined && img3 != 'null')
            data.push({"alt": "入库", "pid": 3, "src": img3});
        if (img4 != undefined && img4 != 'null')
            data.push({"alt": "出库", "pid": 4, "src": img4});

        layui.use('layer', function () {
            layui.layer.photos({
                shade: [0.8, '#393D49']
                , anim: 5
                , photos: {
                    "title": "医废照片", //相册标题
                    "start": 0, //初始显示的图片序号，默认0
                    "data": data
                }
            });
        });

    }

    function to() {
        $.modal.open('添加条码', prefix + "/add_batch");
    }

    function ed(id) {
        $.modal.open('修改条码', prefix + "/edit_batch/" + $.operate.getRowCheckId()[0]);
    }

    //修改行标记删除的颜色
    function rowStyle(row, index) {
        if (row.delFlag == 2) {
            return {
                classes: 'delflag'
            }
        }
        return {};
    }
</script>
</body>
</html>